//引入express模块
const express =require('express');
const pool = require('../pool.js');
//创建文章路由器
const article =express.Router();
//创建文章接口·1
article.get('/article',(req,res)=>{
  //获取文章表中的数据
  let articleid=req.query.articleid;
  let sql='select articleid,articleitem,articletitle,articletime,articlephoto,articlevent,articletou,articledetails from tykyo_article where articleid=?';
  //执行SQL语句
  pool.query(sql,[articleid],(error,results)=>{
    if(error) throw error;
    res.send({message:'ok', code:200,results:results});
  });
});
module.exports=article;